#!/bin/sh -e

export DESTDIR="$1"

# tests/fuzzing now depend on dbus. Remove them from the build.
find . -type f -name meson.build -exec \
    clsed "/subdir('tests')/d;/subdir('fuzzing')/d" {} +

cl-meson \
    -Ddefault_library=both \
    -Dman=false \
    -Dnls=disabled \
    . build

ninja -C build
ninja -C build install

# Purge gdbus.
rm -rf "$1/usr/bin/gdbus"
